public interface ISingleton
{
    void Initialize();
}

/// <summary>
///     ����ģʽ���� ��ҪĿ���Ǳ����������� ��������ʵ�ֵ���ģʽ����
/// </summary>
/// <typeparam name="T"></typeparam>
public class Singleton<T> where T : class, ISingleton, new()
{
    private static T instance;

    public static T Instance
    {
        get
        {
            if (instance == null)
            {
                instance = new T();
                instance.Initialize();
            }

            return instance;
        }
    }
}